package com.binyouwei.designpatterns.behavior.memento;

/**
 * @author 宾有为
 * @date 2024/7/16 19:43
 * @link https://blog.csdn.net/baidu_41616022?type=blog
 * @describe：
 **/
public class MementoOriginator {
    private String state;

    public void setState(String state){
        this.state = state;
    }

    public String getState(){
        return state;
    }

    public Memento saveStateToMemento(){
        return new Memento(state);
    }

    public void getStateFromMemento(Memento Memento){
        state = Memento.getState();
    }
}
